<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>User</title>
    <link rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../themes/icon.css">
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
</head>
<body>
   <form id="ff" method="put" enctype="multipart/form-data">
            <div style="margin-bottom:20px">
                <input class="easyui-textbox" name="name" style="width:100%" data-options="label:'Name:',required:true">
            </div>
            
        </form>
        <div style="text-align:center;padding:5px 0">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">Submit</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">Clear</a>
        </div>
        
        <script>
        function submitForm(){
			$('#ff').form({
				url:'http://localhost:3000/news/data/5a71835b4d86beb20aaf9465',
			    onSubmit: function(){
			    	alert('submit')
			        // do some check
			        // return false to prevent submit;
			    },
			    success:function(data){
			        alert(data)
			    }
			});
			// submit the form
			$('#ff').submit();


			
			
			
        }
        function clearForm(){
            $('#ff').form('clear');
        }
    </script>
</body>
</html>